# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-pyxml
_pkgname=PyXML
pkgver=0.8.4
pkgrel=6
pkgdesc='A fast and simple micro-framework for small web applications.'
arch=('x86_64' 'aarch64')
url='https://pypi.org/project/pyxml/#files'
license=('GPL')
depends=('python2')
makedepends=('python2-setuptools')
source=("https://downloads.sourceforge.net/project/pyxml/pyxml/$pkgver/$_pkgname-$pkgver.tar.gz"
        'setup.py.patch')
sha512sums=('68d9802a58b8ce90d668d2ba659136dc5377e224fdb837284fdcaf640f28b3bb400bf485d602689905d56121b9ffaa7f7758b4a2f262d1321c8b9890952c8a1e'
            '56b899b7d283d0bf078f4b667ad0dcd42373687c360fbc5c1dc07a21dd5677e8bee421fc0c68867da303236561446c7dd5b530cf39cf22e17ce80e005c3ec482')

prepare() {
  patch -p1 < setup.py.patch
}

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

